#ifndef __WebPageQuery_H__
#define __WebPageQuery_H__
#include "SplitToolCppjieba.h"
#include "WebPage.h"
#include <vector>
#include <unordered_map>
#include <set>
#include <memory>

using std::vector;
using std::unordered_map;
using std::set;
using std::pair;
using std::shared_ptr;

class WebPageQuery
{
public:
    WebPageQuery(SplitTool*);
    string doQuery(string key);
private:
    
    void makeWebpage();
    void readIndex();
    vector<double> getX(string key);
private:
    vector<Webpage> _pages;
    unordered_map<int,pair<int,int>> _offetlib;
    unordered_map<string,set<pair<int,double>>> _invertIndexLib;
    shared_ptr<SplitTool> _wordCutTool;
};




#endif
